package de.tudarmstadt.fgbs.cafe.structure;

import java.io.Serializable;

/**
 * Struct for the plugin header information
 * 
 * @author Christian Schlehuber
 * 
 */
public class PluginStruct implements Serializable {

    /**
     * Unique version id which is used for serialization.
     */
    private static final long serialVersionUID = -3393143103373503991L;

    /**
     * The plugin ID, which is used for identification
     */
    private int pluginId;

    /**
     * The name of the plugin
     */
    private String name;

    /**
     * Constructor to set all attributes of the {@link PluginStruct} directly.
     * 
     * @param pluginId
     *            The unique plugin id.
     * @param name
     *            The unique name of the plugin.
     */
    public PluginStruct(int pluginId, String name) {
	this.pluginId = pluginId;
	this.name = name;
    }

    /**
     * Gets the plugin ID
     * 
     * @return The plugin ID
     */
    public int getPluginId() {
	return pluginId;
    }

    /**
     * Sets the plugin ID
     * 
     * @param pluginId
     *            The pluginId
     */
    public void setPluginId(int pluginId) {
	this.pluginId = pluginId;
    }

    /**
     * Gets the name of the plugin
     * 
     * @return The name of the plugin
     */
    public String getName() {
	return name;
    }

    /**
     * Sets the name of the plugin
     * 
     * @param name
     *            The name of the plugin
     */
    public void setName(String name) {
	this.name = name;
    }

    /**
     * Generates a textual representation of this struct. The format is as
     * follows: STRUCT_NAME[FIELD_NAME=VALUE, ... , FIELD_NAME]
     * 
     * @return a textual representation of this struct
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	return "PluginStruct[platformId=" + pluginId + ", name=" + name + "]";
    }
}